<?php

$ids = $_GET["ids"];
$title = $_GET["title"];
$comp_id = $_GET["compId"];
$fb_comp_id = $_GET["fbCompId"];

include("../includes/dbinfo.conf.php");
//echo('hvjasdvjhsd');
if(isset($comp_id)){
	$sql = "update comparision set fb_comparision_id='".$fb_comp_id."' where id='".$comp_id."'";
	mysql_query($sql);
	echo "success";
}else if (isset($ids)) {
    $sql = "insert into comparision(title, item_ids) values ('" . $title . "','" . $ids . "')";
    //echo $sql;
    mysql_query($sql);

    $sql2 = "SELECT * FROM comparision WHERE item_ids = '" . $ids . "'";

    $result = mysql_query($sql2);
    $results = array();
    while ($row = mysql_fetch_array($result)) {
        echo $row['id'];
    }
}
?> 